<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.js"></script>
</head>
<body>
 <div id="app">
   <a href="/add">添加记录</a>
  <table>
    <tr>
      <th>pv_id</th>
      <th>访问时间</th>
      <th>创建时间</th>
      <th>访问链接</th>
      <th>用户设备</th>
    </tr>
    <tr v-for="item in list"> 
      <td >{{item.pv_id}}</td>
      <td >{{item.create_time}}</td>
      <td >{{item.user_href}}</td>
      <td >{{item.user_ip}}</td>
      <td >{{item.user_device}}</td>
      <th><a :href="'/api/delete?pv_id='+item.pv_id">删除</a></th>
    </tr>
  </table>
 </div>
 <script>
     new Vue({
         el:'#app',
         data:{
           list:[]
         },
         mounted(){
           let that= this;
          $.post('/api/list',{username:'888'},function(res){
              that.list = res;
          })
         }
     })
 </script>
</body>
</html>